package net.amsoft.iservice.icontact.hibernate;

import java.util.HashSet;
import java.util.Set;

public class Subscriber extends IContactObject {
	private IBroker broker;
	private Set synonyms = new HashSet();

	public Subscriber() {
	}

	public IBroker getBroker() {
		return this.broker;
	}
	public void setBroker(IBroker broker) {
		this.broker = broker;
	}

	public Set getSynonyms() {
		return this.synonyms;
	}
	public void setSynonyms(Set synonyms) {
		this.synonyms = synonyms;
	}

	public void addSynonym(Synonym synonym) {
		synonym.setSubscriber(this);
		this.synonyms.add(synonym);
		synonym.insert();
	}
	public void removeSynonym(Synonym synonym) {
		this.synonyms.remove(synonym);
		synonym.remove();
	}

    // public void debug(String prefix) {
    // System.out.print(prefix);
    // System.out.print("Subscriber (" + id + ", " + broker.getId() + ", "
    // + creationTime + ", " + modificationTime + ", "
    // + synonyms.size() + ", " + state + ")\n");
    //	}
}
